<%@page import="entity.Course"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>管理页面</title>

  </head>
  
  <body>
                              <jsp:useBean id="user" class="entity.User" scope="session"></jsp:useBean>
                                    <jsp:include page="top.jsp"></jsp:include><br>
                                    <font color='blue'>欢迎使用本系统....</font><br><br>
                                    <jsp:include page="add.jsp"></jsp:include><br>
                                   
              
		<c:if test="${ user.username=='admin'}">
		 <table border="1">
        <tr>
        <td colspan="7" align="center">课程信息表</td>
        </tr>
        <tr>
     
        <td>课程名字</td>
        <td>开课时间</td>
        <td>课程学分</td>
        <td>操作列表</td>
        </tr>
	 <c:forEach items="${sessionScope.list}" var="course" >
        <tr>
            <td>${course.name}</td>
            <td>${course.term}</td>
            <td>${course.credit}</td>
            <td><a href="servlet/removeservlet?name=${ course.name}">删除此纪录</a>
            <a href="edit.jsp?name=${ course.name}">修改此纪录</a></td>
            </tr>
            </c:forEach>   
            </table><br><br>
            </c:if>
  <a href="loginmain.jsp">退出登录</a>
        
        
        
        
        
        
        
                                                                               
                                                                                            
                                                                                            
                                                                                            
                                                                              

  </body>
</html>
